// HJ50 [没仔细看][栈]四则运算
// https://www.nowcoder.com/practice/9999764a61484d819056f807d2a91f1e
#include <iostream>
#include <stack>
using namespace std;
string mp = "+-*/)]}";
// 当前运算符与符号栈的栈顶运算符做优先级比较，
// 如果当前优先级高，则不做运算压入栈中，相同进行运算
bool cmp(char c1, char c2) {
  if (c1 == '(') {
    return false;
  } else if ((c1 == '+' || c1 == '-') && (c2 == '*' || c2 == '/')) {
    return false;
  }
  return true;
}
void doCal(stack<double> &stNum, stack<char> &stOp) {
  double b = stNum.top();
  stNum.pop();
  double a = stNum.top();
  stNum.pop();
  int op = stOp.top();
  stOp.pop();
  if (op == '+')
    a = a + b;
  else if (op == '-')
    a = a - b;
  else if (op == '*')
    a = a * b;
  else if (op == '/')
    a = a / b;
  stNum.push(a);
  return;
}
int main() {
  string s;
  while (getline(cin, s)) {
    stack<double> stNum;
    stack<char> stOp;
    stOp.push('(');
    s += ')';
    bool nextIsOp = false;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '{' || s[i] == '[' || s[i] == '(') {
        stOp.push('(');
      } else if (s[i] == ')' || s[i] == ']' || s[i] == '}') {
        while (stOp.top() != '(') doCal(stNum, stOp);
        stOp.pop();  // pop (
      } else if (nextIsOp) {
        while (cmp(stOp.top(), s[i])) doCal(stNum, stOp);
        stOp.push(s[i]);
        nextIsOp = false;
      } else {
        int j = i;
        if (s[j] == '-' || s[j] == '+') i++;
        while (mp.find(s[i]) == mp.npos) i++;
        string t = s.substr(j, i - j);
        stNum.push((double)stoi(t));
        i--;
        nextIsOp = true;
      }
    }
    cout << stNum.top() << endl;
  }
  return 0;
}